class bubblesort {
    public static void bubblesort(int array[]) {
        int n = array.length;
        int k;
        for (int m = n; m >= 0; m--) {
            for (int i = 0; i < n - 1; i++) {
                k = i + 1;
                if (array[i] > array[k]) {
                    swap(i, k, array);
                }
            }
            printNumbers(array);
        }
    }
 
    public static void swap(int i, int j, int[] array) {
 
        int temp;
        temp = array[i];
        array[i] = array[j];
        array[j] = temp;
    }
	public static void printNumbers(int[] input) {
         
        for (int i = 0; i < input.length; i++)
            System.out.print(input[i] + ", ");
			}
			System.out.println("\n");
		}
		public static void main(String[] felight) {
        int[] input = { 66, 22, 55, 99, 11, 33};
        bubblesort(input);
 }
 }